package ie.dkit.java3Demulation.objects;

import java.util.ArrayList;
import java.util.Collection;

import ie.dkit.java3Demulation.drawer.LineDrawable;

/**
 * @author Sebastian Ruehl
 * 
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 * Place, Suite 330, Boston, MA 02111-1307 USA
 */
public class Line implements LineDrawable {
	private Point m_PointA;

	private Point m_PointB;

	private String name;

	/**
	 * Default creates a Line from -10 to 10 on x
	 * 
	 */
	public Line() {
		m_PointA = new Point(-10, 0);
		m_PointA.setName("Point A");
		m_PointB = new Point(10, 0);
		m_PointB.setName("Point B");
	}

	/**
	 * @param m_a
	 * @param m_b
	 */
	public Line(Point m_a, Point m_b) {
		super();
		m_PointA = m_a;
		m_PointB = m_b;
	}

	/**
	 * @return the a
	 */
	public Point getPointA() {
		return m_PointA;
	}

	/**
	 * @param a
	 *            the a to set
	 */
	public void setPointA(Point a) {
		m_PointA = a;
	}

	/**
	 * @return the b
	 */
	public Point getPointB() {
		return m_PointB;
	}

	/**
	 * @param b
	 *            the b to set
	 */
	public void setPointB(Point b) {
		m_PointB = b;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see ie.dkit.java3Demulation.objects.GraphicsObject#getName()
	 */
	public String getName() {
		return name;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see ie.dkit.java3Demulation.objects.GraphicsObject#setName(java.lang.String)
	 */
	public void setName(String name) {
		this.name = name;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see ie.dkit.java3Demulation.linedrawing.Drawable#getLines()
	 */
	public Collection<Line> getLines() {
		Collection<Line> returnValue = new ArrayList<Line>();
		returnValue.add(this);
		return returnValue;
	}
}
